-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #9958: Avoid eta contractions when printing #9979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Don't eta contract if the result type of a lambda is an applied type that's treated specially.
Does this also fixes #9971? |
The unapply method of EtaExpansion was missing several necessary conditions, which are now added: - parameters and arguments must have same length - bounds must conform
#9971 was a different, and deeper problem. It's now also fixed. |
Fixes #9971 |
37a7924
to
5e56416
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
It looks like #9965 is starting to cause issues in many places.
onlyEmptyBounds | ||
// Note: this pre-test helps efficiency. It is also necessary since in some cases | ||
// tparams is empty. This can happen when we change the owners of inlined local | ||
// classes in mapSymbols. See pos/reference/delegates.scala for an example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the manifestation of #9965 which I also encountered in #9954.
It happens when inlining
https://github.com/lampepfl/dotty/blob/a128dab3a435a9eb3aa7a8cba359a9989a73d9c2/tests/pos/reference/delegates.scala#L114-L115
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@odersky does this match what you saw while debugging or are there other problematic cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I saw, yes.
Co-authored-by: Nicolas Stucki <nicolas.stucki@gmail.com>
Don't eta contract if the result type of a lambda is an applied
type that's treated specially.